import 'package:flutter/material.dart';
import 'package:table_calendar/table_calendar.dart';

import '../../../core/widget/custom_app_bar.dart';

class ClockIn extends StatefulWidget {
  const ClockIn({Key? key}) : super(key: key);

  @override
  State<ClockIn> createState() => _ClockInState();
}

class _ClockInState extends State<ClockIn> {

  DateTime _focusedDay = DateTime.now();

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: customAppbar(context: context, title: '考勤签到'),
      body: Container(
        child: Center(
          child: TableCalendar(
            focusedDay: _focusedDay,
            firstDay: DateTime.utc(2000, 12, 12),
            lastDay: DateTime.utc(2100, 12, 12),
            onDaySelected: (selectDay, focusedDay) {
              debugPrint('selectDay: ${selectDay}');
              debugPrint('focusedDay: ${focusedDay}');
              setState(() {
                _focusedDay = focusedDay;
              });
            },
          ),
        ),
      ),
    );
  }
}
